home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / ctutor.arc / SIMPLEIO.C < prev    next >
Encoding:
C/C++ Source or Header  |  1988-02-28  |  384 b   |  16 lines

  1. #include "stdio.h"    /* standard header for input/output */
  2.  
  3. main()
  4. {
  5. char c;
  6.  
  7.    printf("Enter any characters, X = halt program.\n");
  8.  
  9.    do {
  10.       c = getchar();    /* get a single character from the kb */
  11.       putchar(c);       /* display the character on the monitor */
  12.    } while (c != 'X');  /* until an X is hit */
  13.  
  14.    printf("\nEnd of program.\n");
  15. }
  16.